package org.basic.mail.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author xiaoyu
 * @date 2023/7/27
 * @apiNote 邮箱SSL
 */
@Getter
@AllArgsConstructor
public enum MailSSL {
    /**
     * SSL已开启
     */
    ENABLE(1, true),

    /**
     * SSL未开启
     */
    DISENABLED(0, false);

    private final Integer code;

    private final boolean status;

    public static boolean getStatus(Integer code) {
        if (ENABLE.code.equals(code)) {
            return ENABLE.status;
        } else {
            return DISENABLED.status;
        }
    }
}
